Test Series - java script

Test Number 67/92

Q: What is the function of the XML parser?
A. Converts XML document to XML DOM object
B. Converts XML DOM object to XML document
C. Converts XML DOM object to a comment
D. Compiles the html document
Solution: An XML parser converts an XML document into an XML DOM object – which can then be manipulated with JavaScript. All major browsers have a built-in XML parser to access and manipulate XML.
Q: To which of the following object does the print() method belong to?
A. window
B. document
C. hash
D. string
Solution: The method print() belongs to the window object. The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
Q: What is the purpose of the method ActiveXObject()?
A. Used to call automation object
B. Used to reference automation object
C. Used to instantiate automation object
D. Used to call & reference automation object
Solution: The ActiveXObject.prototype object allows adding properties and methods to the ActiveXObject object that can be used with instances of the ActiveXObject object like any predefined property or method. The ActiveXObject() object is used only to instantiate Automation objects, and has no members.
Q: What is the purpose of the url json?
A. Belongs to JSON object
B. Reference JSON formatted data
C. Belongs to JSON
D. Compiles json data
Solution: The URL JSON is assumed to reference a file of JSON-formatted data. The value passed to the callback is the object obtained by parsing the URL contents with jQuery.parseJSON(). jQuery.getJSON() uses this type. If the type is “json” and the URL or data string contains “=?”, the type is converted to “jsonp”.
Q: Which is the function in JavaScript that will print the current page in JavaScript?
A. print()
B. printcurrent()
C. print(now)
D. print(this)
Solution: The print() method prints the contents of the current window. The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
Q: What is the parameter of the method Date.parse()?
A. date
B. string
C. datestring
D. string
Solution: The parse method is defined as Date.parse(datestring). The parse() method parses a date string and returns the number of milliseconds between the date string.
Q: What does it indicate when the radix value is 16?
A. String begins with 0x
B. String begins with 0
C. String begins with 0P
D. String begins with FF
Solution: If the string begins with “0x”, the radix is 16 (hexadecimal). If the string begins with “0”, the radix is 8 (octal).
Q: What will be the radix value if the string begins with 0x?
A. 13
B. 14
C. 15
D. 16
Solution: If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal). If the string begins with any other value, the radix is 10 (decimal).
Q: What will happen if the radix parameter of the parseInt() function is omitted?
A. Runs in assumption
B. Throws exception
C. Aborts
D. Taken as 0
Solution: The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
If the string begins with “0x”, the radix is 16 (hexadecimal)
If the string begins with “0”, the radix is 8 (octal). This feature is deprecated
If the string begins with any other value, the radix is 10 (decimal)
Q: What is the function of the parseInt() method?
A. Parses a data type and stores in an integer
B. Parses a string and returns an integer
C. Parses an integer and returns a string
D. Parses a string and return an object
Solution: The function parseInt() method parses a string and returns an integer. If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal).

You Have Score    /10